##字符串str
# 1 使用引号，
s1 ='hello world'
print(s1)
print(type(s1))
#
s2 ='你好,石家庄'
print(s2)
print(type(s2))

#2
num1 =10
print(type(num1))
s3=str(num1)
print(s3)
print(type(s3))
num2=3.141592653
print(type(num2))
s4=str(num2)
print(s4)
print(type(s4))

#字符串的格式化、
1
s5='浮点数精确为:%f' %1.2345
print(s5)
s6 ='浮点型精确为:%.3f' %1.2345
print(s6)
#整形转化
s7 ='整数精确为:%d'% 1.2345
print(s7)
#字符串转化
s8 = '字符串为%s' % 1.2345
print(s8)

2
print('{}{}'.format('hellp','world'))

##字符串的合并
#1使用+对多个字符串进行链接
s9="hello"
s10="world"
print(s9*10)

#2 使用join函数配合列表实现对多个字符串的链接
s11=['hello','python','hello','world']
s12='123我很好'
print(''.join(s11))
print(s12.join(s11))

#字符串的截取
#1
s13 = 'python'
print(s13[3])
print(s13[-3])
#2
s14 = 'python'
print(s14[0:5])
print(s14[2:5])
print(s14[3:1])

#3
s15 = '开始,    1,    2,   3333,    4,    5,6'
print(s15.split())
print(s15.split('3333'))